package listener.usuallistener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * @description 生命周期监听器: 
 *                      类似的还有HttpSessionListener ServletRequestListener, 方法基本一致
 *
 * @author linshuo
 *
 */
public class LifeListener implements ServletContextListener{

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("我随着服务器的开启而诞生");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("我随着服务器的关闭而死亡"); 
    }

}
